home *** CD-ROM | disk | FTP | other *** search
/ Amiga Tools 3 / Amiga Tools 3.iso / rexx / vignettegrey.rexx < prev    next >
OS/2 REXX Batch file  |  1995-04-11  |  1KB  |  56 lines

  1. /**************************************************/
  2. /* Image Engineer script                          */
  3. /* by Simon Edwards                               */
  4. /* Applies a blurred Vignette effect to an image. */
  5. /**************************************************/
  6.  
  7. Options results
  8. signal on error            /* Setup a place for errors to go */
  9.  
  10. if arg()==0 then exit
  11.  
  12. PROJECT_INFO arg(1) Type
  13. if result='GREY' then exit
  14.  
  15. CONVERT_TO_GREY arg(1)
  16. greyimage=result
  17. PROJECT_INFO arg(1) Width
  18. width=result
  19. PROJECT_INFO arg(1) Height
  20. height=result
  21.  
  22. TYPE 8BIT
  23. 'OPEN IE:alpha/Spherical.alpha'
  24. alphachannel=result
  25. SCALE alphachannel width height BEST
  26. newalpha=result
  27. CLOSE alphachannel
  28.  
  29. MARK arg(1) PRIMARY
  30. MARK greyimage SECONDARY
  31. MARK newalpha ALPHA
  32. COMPOSITE 0 0 ALPHA
  33.  
  34. CLOSE newalpha
  35. CLOSE greyimage
  36.  
  37. exit
  38.  
  39. /*******************************************************************/
  40. /* This is where control goes when an error code is returned by IE */
  41. /* It puts up a message saying what happened and on which line     */
  42. /*******************************************************************/
  43. error:
  44. if RC=5 then do            /* Did the user just cancel us? */
  45.     IE_TO_FRONT
  46.     LAST_ERROR
  47.     'REQUEST "'||RESULT||'"'
  48.     exit
  49. end
  50. else do
  51.     IE_TO_FRONT
  52.     LAST_ERROR
  53.     'REQUEST "Error detected!!!'||D2C(10)||'Image Engineer error message is as follows'||D2C(10)||result||D2C(10)||'Script failed on line '||SIGL||'"' 'Doh!'
  54.     exit
  55. end
  56.